<?php if(!defined('CALL')) exit('No direct script access allowed');

include_once('lib/utils.class.php');
include_once('lib/xtemplate.class.php');
include_once('lib/logger.class.php');

class vSignup
{

	public static function build_before()
	{
		$xtpl = new XTemplate('xtpl/main-signup.xtpl');
		$xtpl->assign('root', ROOT_URL);
		$xtpl->parse('root.before');
		$xtpl->parse('root');
		return $xtpl->text('root');
	}
	
	public static function build_after($email)
	{
		$xtpl = new XTemplate('xtpl/main-signup.xtpl');
		$xtpl->assign('root', ROOT_URL);
		$xtpl->assign('email', $email);
		$xtpl->assign('city_id', '0');
		$xtpl->parse('root.after');
		$xtpl->parse('root');
		return $xtpl->text('root');
	}
	
	public static function build_error($title, $message)
	{
		$xtpl = new XTemplate('xtpl/main-signup.xtpl');
		$xtpl->assign('root', ROOT_URL);
		$xtpl->assign('title', $title);
		$xtpl->assign('message', $message);
		$xtpl->parse('root.error');
		$xtpl->parse('root');
		return $xtpl->text('root');
	}
	
	public static function build_info($title, $message)
	{
		$xtpl = new XTemplate('xtpl/main-signup.xtpl');
		$xtpl->assign('root', ROOT_URL);
		$xtpl->assign('title', $title);
		$xtpl->assign('message', $message);
		$xtpl->parse('root.info');
		$xtpl->parse('root');
		return $xtpl->text('root');
	}
	
	public static function build_mail_message($url)
	{
		$xtpl = new XTemplate('xtpl/main-signup.xtpl');
		$xtpl->assign('root', ROOT_URL);
		$xtpl->assign('url', $url);
		$xtpl->parse('root.mail_message');
		$xtpl->parse('root');
		return $xtpl->text('root');
	}
	
}